1. Field of the Invention
The present invention generally relates to improving operating system efficiency and, more particularly, to systems and methods for reducing the frequency of operating system calls made from and/or to a user process.
2. Background Description
FIG. 1, generally at 100, is a conventional computer system that shows the relationship between application programs 101a-n, kernel 105, and hardware 107. Application programs 101a-n can include, for example, conventional word processing, graphic and/or web browser programs, that directly interact with an end user. Application programs 101a-n are executed in user-space 103, and can be referred to as “processes,” or “tasks” when program instructions are executed by the central processing unit (CPU) (not shown).
Kernel 105 includes system call interface 109, kernel subsystems 111, and device drivers 113. Application programs 101a-n communicate with kernel 105 by making a conventional system call. System call interface 109 can receive requests from processes to access hardware 107 such as printers, monitors, storage devices and/or network devices. Kernel 105 can execute these requests via kernel subsystems 111 and device derivers 113 in a conventional manner. Kernel subsystems 111 can include interrupt handlers to service interrupt requests, a memory management system to manage address spaces, and system services such as networking and interprocess communication (IPC).
As noted above, when performing conventional asynchronous input-output (AIO) between application programs 101a-n and kernel 105, application programs 101a-n invoke a system call to kernel 105 to initiate each input-output (I/O). For example, an application program 101a-n typically calls a function in a library, such as a C library, that in turn relies on system call interface 109 to instruct kernel 105 to conduct one or more tasks on its behalf. When a system call takes place, an application program 101a-n that makes the call is suspended, and the kernel 105 takes over. The context switch from the application program 101a-n to kernel 105 is costly in terms of performance, as system calls can take, for example, 10 to 1000 times more processing time than a normal processing operation, such as a CPU adding two numbers together.
Conventional techniques attempt to reduce the number of signals by ensuring that I/O requests are as large as possible, such as by allowing submission of batches of requests at a time, and/or using larger buffers (or user cache) to capture many I/O requests in the user process space before the I/O library transfers the data out. These techniques can be effective when the needed I/O is known in advance. However, these techniques are not generally effective in a streaming request environment (such as a web server).
One or more embodiments of the present invention are directed to reducing the number of operating system calls that are made from and/or to a user process.